﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections;
using System.Data;

/// <summary>
///PageBase 的摘要说明
/// </summary>
public class PageBase : System.Web.UI.Page
{
    protected string thisPage = string.Empty;
    protected string thisPageParameters = string.Empty;
    protected WebSessions UserSession = null;
    protected int LoginUserId = 0;
    protected string LoginUserName = string.Empty;
    protected DataTable LoginUserPower = new DataTable();
    protected string LoginUserPowerString = string.Empty;
    protected Hashtable LoginUserPPowerHashtable = new Hashtable();

	public PageBase()
	{
		//
		//TODO: 在此处添加构造函数逻辑
		//
	}

    protected override void OnLoad(EventArgs e)
    {
        if (Session["WebSessions"] != null)
        {
            WebSessions m = (WebSessions)Session["WebSessions"];
            LoginUserId = m.UserID;
            LoginUserName = m.UserName;
            thisPageParameters = Request.RawUrl;
            thisPage = thisPageParameters;

            if (thisPageParameters.IndexOf("?") > -1)
            {
                thisPage = thisPageParameters.Substring(0, thisPageParameters.IndexOf("?"));
            }
        }
        else
        {
            Response.Write("<script>top.location.href='/Admin/login.aspx'</script>");
            return;
        }

        base.OnLoad(e);
    }
}